Repository navigation
brainpoolP512r1 x86-64: sign by the fixed-base comb for any a - #4413
Merged
Merged
Conversation
alex
enabled auto-merge
November 7, 2026 09:19
This was referenced Nov 7, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 7, 2026
|
This pull request has conflicts with Posted by |
alex
force-pushed
the
claude/perf-4141-brainpool-512-sign
branch
from
November 7, 2026 10:06
53108cf to
15edc59
Compare
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 7, 2026
|
This pull request has conflicts with Posted by |
…rate not yet regenerated) The 7-bit comb tables for brainpoolP512r1 (74 tables of 64 points, with their kernel-checked certificate, Proof/BrainpoolP512r1/Comb7.lean) and the signature's [k]G by #4406's general-a comb (Cfg.signG). No change to TCB/ or Spec/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHGTpD61aE4mEnWpUJP
vg_ecdsa_brainpoolp512r1_sign_k computes [k]G by the comb from the static VG_BRAINPOOLP512R1_COMB (Emit.lean); and say why the tables' certificate is a module of its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHGTpD61aE4mEnWpUJP
…1's comb Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHGTpD61aE4mEnWpUJP
alex
force-pushed
the
claude/perf-4141-brainpool-512-sign
branch
from
November 7, 2026 10:39
15edc59 to
e2bddf6
Compare
alex
enabled auto-merge
November 7, 2026 10:41
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #4141 (audit findings).
Stacked on #4406 (its commit
ffa15e20is the first in this branch; I'll restack ontomainonce it merges). This PR's own changes are the commits after it.What was slow
brainpoolP512r1 ECDSA signing on x86-64 (prehashed, full features) took 2.15 ms against OpenSSL's 1.19 ms (1.8×). The signature computed
[k]Gby the ladder of complete additions: 512 doublings and additions. x86-64's comb adds by the complete formulas fora = -3, and brainpoolP512r1'sais not-3.What changed
[k]Gnow uses brainpoolP256r1 x86-64: sign by a fixed-base comb for any a #4406's comb with the complete addition for anya(Cfg.signG): 74 additions.Impl/BrainpoolP512r1/CombTable7.lean, 74 tables of[m 2^(7j)]Gform = 1 … 64, plus the comb's starting point. I computed them with Python's integers (affine addition, inverses by Fermat). The same script reproduces brainpoolP256r1's existing tables and partial sums exactly.Proof/BrainpoolP512r1/Comb7.lean, built the way P-256's and brainpoolP256r1's are (combChecksW_of_fast, about 3 s). Nonative_decide.VG_BRAINPOOLP512R1_COMB, which is the signing configuration'sgtab. SocombConsts, the contract and the RFC 6979 registration list it, as in brainpoolP256r1 x86-64: sign by a fixed-base comb for any a #4406.brainpoolp512r1S_shgoes throughbrainpoolp512r1S.C = brainpoolp512r1.C, because the direct defeq check with the larger table hits the elaborator's recursion limit.brainpoolp512r1S.Rrather than the literal2 ^ 512.CombGeneral,TCombGeneral),TCB/orSpec/. Rust is unchanged apart from the regenerated crate.Numbers
Benchmarks workflow run (x86_64,
ecdsa_brainpoolp512r1, the sign groups, base #4406's commit, with OpenSSL). Full features (VG_CPU_FEATURES=avx,avx2,bmi1,bmi2,adx):ecdsa_brainpoolp512r1_sha512_sign_prehashed/64ecdsa_brainpoolp512r1_sha512_sign/1024ecdsa_brainpoolp512r1_sha512_sign/16384ecdsa_brainpoolp512r1_sha512_sign/64VG_CPU_FEATURES=nonegives the same picture: prehashed signing goes from 1.77 ms to 156.22 µs (91.2% faster).Local run, Intel Xeon @ 2.10 GHz (Sapphire Rapids),
ci/bench_compare.py --modules ecdsa_brainpoolp512r1 --opensslagainstmain: prehashed signing goes from 2.04 ms to 182.5 µs (91.1% faster); OpenSSL takes 1.08 ms.Checks
check_lean_public_imports.pypasses on the edited modules.lake buildandEmit.leanboth pass; the regenerated crate is committed.cargo fmt --checkandclippy -D warningspass.cargo test(Wycheproof) passes, also withVG_CPU_FEATURES=none.🤖 Generated with Claude Code
https://claude.ai/code/session_01TKUFHGTpD61aE4mEnWpUJP